<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Route
 *
 * @author ttp
 */
class App_Controller_Router_Route extends Zend_Controller_Router_Route_Module
{
    public function match($path, $partial = false)
    {
        if (strpos($path, '/admin/') === false) {
            $result = parent::match($path, $partial);
        } else {
            $path = str_replace('/admin', '', $path);
            $result = parent::match($path, $partial);
            if ($result) {
                $result['controller'] = 'admin_' . $result['controller'];
            }
        }
        if ($result) {
            $result['module'] = ucfirst($result['module']);
        }
        
        return $result;
    }
}